<template>
  <div class="home-index">
    <transition name="van-slide-up">
      <div v-show="visible">
        <div class="van-haptics-feedback">首页</div>
      </div>
    </transition>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
// import { fetchUserInfo } from "@/api/index";
//由于awaitWrap类型推导很麻烦，所以还是采用 try catch 来捕获错误，既能捕获接口错误，也能捕获业务逻辑错误

const fetchData = async () => {
  try {
    let res = await fetchUserInfo();
    console.log(res);
  } catch (error) {
    console.log(error);
  }
};

const visible = ref(false);
onMounted(() => {
  setTimeout(() => {
    visible.value = true;
  }, 300);
  // setTimeout(() => {
  //   visible.value = false;
  // }, 800);
});
</script>

<style lang="scss" scoped>
.home-index {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
